<?php
$data=Array
(Array("id" => 16,"cname" => 电脑,"pid" => 15,"path" => "0_15","describe" => "电脑","is_visible" => 1,"keyword" => "品牌电脑","level" => 2,"short_name"=>"电脑"));
function _get_child($data, $pid=0){
        $array = array();
        foreach ($data as $k => $v){
            if ($v['pid'] == $pid){
                $v['child'] = self::_get_child($data, $v['id']); //递归
                $array[] = $v;
            }else{
				$array[]=$v;
			}
        }
        return $array;
    }
$arr = _get_child($data);

print_r($arr);